<?php


namespace App\Factory;


class CheckText implements Check
{
    /*
     * 审核文本
     */
    function start($text){
        $token = (new \App\service\Check())->token();
        $url = 'https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined?access_token=' . $token;
        $bodys = array(
            'text' => $text
        );
        $res = (new \App\service\Check())->curlPost($url, $bodys);

        return json_decode($res,true)['conclusion'];
    }
}
